<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['middleware' => 'api'], function () {
    Route::get('captcha', 'ServiceController@captcha');

    Route::post('sendMessageWithoutToken', 'ServiceController@sendMessageWithoutToken');
    Route::post('sendEmail', 'ServiceController@sendMessageWithoutToken');

    //Route::get('test', 'AuthController@test');
    Route::group(['prefix' => 'auth'], function () {
        Route::post('register', 'AuthController@register');
        Route::post('login', 'AuthController@login');
        Route::post('logout', 'AuthController@logout');
        Route::post('refresh', 'AuthController@refresh');
    });

    Route::group(['prefix' => 'user','middleware'=>'auth.api'], function () {
        Route::post('count', 'CountController@count');
        Route::get('info', 'CountController@userInfo');
        Route::get('countRecord', 'CountController@countRecord');
    });



});



